package com.moxie.ocr.ocr.base;


import android.support.v7.app.AppCompatActivity;
/**
 * 权限申请管理器
 * 通过透明的DialogFragment去申请权限
 */
public class MXPermissionManager {
    MXPermissionDialog mxPermissionDialog;

    public MXPermissionManager(PermissionListener permissionListener){
        mxPermissionDialog = new MXPermissionDialog();
        mxPermissionDialog.setListener(permissionListener);
    }

    public void startRequestPermission(AppCompatActivity activity){
        mxPermissionDialog.show(activity.getSupportFragmentManager(),"permissionFragmentDialog");
    }


    public interface PermissionListener{
        void allGranted();
        void deniedPermission(String[] deniedPermission);
    }



}
